//
//  BaseTabbarController.m
//  Experss
//
//  Created by 嗯，大葱 on 17/7/27.
//  Copyright © 2017年 嗯，大葱. All rights reserved.
//

#import "BaseTabbarController.h"
#import "SeouYeViewController.h"
#import "LZCartViewController.h"

#import "DingDanViewController.h"
#import "MineViewController.h"
#import "FenLeiViewController.h"

#import "Express.pch"


@interface BaseTabbarController ()

@end

@implementation BaseTabbarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //默认字体颜色
    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor], UITextAttributeTextColor, nil] forState:UIControlStateNormal];
    
    
    //选中颜色
    [[UITabBarItem appearance] setTitleTextAttributes:                                                         [NSDictionary dictionaryWithObjectsAndKeys:kNavBarColor,UITextAttributeTextColor, nil]forState:UIControlStateSelected];
    [self configureTabarViewController];
}
- (void)configureTabarViewController {

    
    
    SeouYeViewController  *homePage = [[SeouYeViewController alloc] init];
    UINavigationController *firstVC = [[UINavigationController alloc] initWithRootViewController:homePage];
    firstVC.title = @"首页";
    firstVC.tabBarItem.image = [[UIImage imageNamed:@"biaoqian_shouye2"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    firstVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"biaoqian_shouye1"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    
    FenLeiViewController*findDoc = [[FenLeiViewController alloc] init];
    UINavigationController *fD = [[UINavigationController alloc] initWithRootViewController:findDoc];
    fD.title = @"分类";
    fD.tabBarItem.image = [[UIImage imageNamed:@"biaoqian_fenlei2"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    fD.tabBarItem.selectedImage = [[UIImage imageNamed:@"biaoqian_fenlei1"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    

    LZCartViewController *hot = [[LZCartViewController alloc] init];
    UINavigationController *secondVC = [[UINavigationController alloc] initWithRootViewController:hot];
    hot.title = @"购物车";
    secondVC.tabBarItem.image = [[UIImage imageNamed:@"biaoqian_gouwuche2"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    secondVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"biaoqian_gouwuche1"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    
  
    DingDanViewController *classify = [[DingDanViewController alloc]init];
    UINavigationController *thirdVC = [[UINavigationController alloc] initWithRootViewController:classify];
    thirdVC.title = @"订单";
    thirdVC.tabBarItem.image = [[UIImage imageNamed:@"biaoqian_dingdan2"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    thirdVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"biaoqian_dingdan1"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    
    
    //社区
    MineViewController *five = [[MineViewController alloc]init];
    UINavigationController *fiveN = [[UINavigationController alloc] initWithRootViewController:five];
    fiveN.navigationBar.barTintColor  = [UIColor whiteColor];
    fiveN.title = @"我的";
    fiveN.tabBarItem.image = [[UIImage imageNamed:@"biaoqian_wode2"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    fiveN.tabBarItem.selectedImage = [[UIImage imageNamed:@"biaoqian_wode1"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    
    self.viewControllers = @[firstVC,fD,secondVC,thirdVC,fiveN];
    
    
    
    
    [[UITabBar appearance] setBarTintColor:[UIColor whiteColor]];
    [UITabBar appearance].translucent = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
